package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CleaningMapper;
import com.ruoyi.system.domain.Cleaning;
import com.ruoyi.system.service.ICleaningService;

/**
 * 服务类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-18
 */
@Service
public class CleaningServiceImpl implements ICleaningService 
{
    @Autowired
    private CleaningMapper cleaningMapper;

    /**
     * 查询服务类型
     * 
     * @param cId 服务类型ID
     * @return 服务类型
     */
    @Override
    public Cleaning selectCleaningById(Long cId)
    {
        return cleaningMapper.selectCleaningById(cId);
    }

    /**
     * 查询服务类型列表
     * 
     * @param cleaning 服务类型
     * @return 服务类型
     */
    @Override
    public List<Cleaning> selectCleaningList(Cleaning cleaning)
    {
        return cleaningMapper.selectCleaningList(cleaning);
    }

    /**
     * 新增服务类型
     * 
     * @param cleaning 服务类型
     * @return 结果
     */
    @Override
    public int insertCleaning(Cleaning cleaning)
    {cleaning.setCreateTime(DateUtils.getNowDate());
        return cleaningMapper.insertCleaning(cleaning);
    }

    /**
     * 修改服务类型
     * 
     * @param cleaning 服务类型
     * @return 结果
     */
    @Override
    public int updateCleaning(Cleaning cleaning)
    {
        return cleaningMapper.updateCleaning(cleaning);
    }

    /**
     * 批量删除服务类型
     * 
     * @param cIds 需要删除的服务类型ID
     * @return 结果
     */
    @Override
    public int deleteCleaningByIds(Long[] cIds)
    {
        return cleaningMapper.deleteCleaningByIds(cIds);
    }

    /**
     * 删除服务类型信息
     * 
     * @param cId 服务类型ID
     * @return 结果
     */
    @Override
    public int deleteCleaningById(Long cId)
    {
        return cleaningMapper.deleteCleaningById(cId);
    }
}
